<ion-view title="延期申请">
  <ion-content>
    <div class="list">
      <label class="item">
        假期类型
        <span class="item-note">{{vacationsAddDelayDetailCtrl.firstType.name}}</span>
      </label>
      <label class="item item-input item-stacked-label">
        <span class="input-label">延期类型</span>
        <ion-list>
          <ion-checkbox ng-repeat="subtype in vacationsAddDelayDetailCtrl.firstType.subTypes" ng-model="subtype.isCheck">{{subtype.name}}  <span ng-if="subtype.duration != 0">{{subtype.duration}}天</span></ion-checkbox>
        </ion-list>
      </label>

      <label class="item item-input item-stacked-label">
        <span class="input-label">申请理由</span>
        <textarea ng-model="vacationsAddDelayDetailCtrl.vacationDelay.reason" placeholder="请填写申请理由" rows="5"></textarea>
      </label>
      <label class="item item-stacked-label">
        <span class="input-label">证明材料</span>
        <div>
          <img ng-repeat="src in vacationsAddDelayDetailCtrl.srclist" ng-src="{{src}}" style="width: 80px; height: 80px; padding: 5px 10px 5px 10px;"/>
          <button class="button button-clear icon ion-plus" ng-click="vacationsAddDelayDetailCtrl.showActionSheet()" ng-show="vacationsAddDelayDetailCtrl.srclist.length < 3" style="background-color: #fff; max-height:80px; height:80px; width: 80px"></button>
        </div>
      </label>
      <!-- <div class="item">
        <span class="input-label">时间精度</span>
        <ion-list>
          <ion-radio ng-model="vacationsAddDelayDetailCtrl.isdate" ng-value="true">天</ion-radio>
          <ion-radio ng-model="vacationsAddDelayDetailCtrl.isdate" ng-value="false">小时</ion-radio>
        </ion-list>
      </div> -->
      <div class="item">
        <span class="input-label">延期时间</span>
        <div class="">
          <p ng-repeat="item in vacationsAddDelayDetailCtrl.timelist" style="text-align: center">
            <p ng-repeat="item in vacationsAddDelayDetailCtrl.timelist" style="text-align: center">
              {{item.start | date:'MM月dd日HH点'}}
              ~
              {{item.end | date:'MM月dd日HH点'}}
              <i class="ion-close-round" ng-click="vacationsAddDelayDetailCtrl.deleteTime(item)" style="float: right; color: red"></i>
            </p>
          </p>
        </div>
        <button class="button button-block button-positive" ng-click="vacationsAddDelayDetailCtrl.set('start')" ng-show="vacationsAddDelayDetailCtrl.isAdding">
          起始时间
          {{vacationsAddDelayDetailCtrl.startdate | date:'yy年MM月dd日'}}
          <standard-time-no-meridian etime="vacationsAddDelayDetailCtrl.starttime"></standard-time-no-meridian>
        </button>
        <button class="button button-block button-assertive" ng-click="vacationsAddDelayDetailCtrl.set('end')" ng-show="vacationsAddDelayDetailCtrl.isAdding">
          终止时间
          {{vacationsAddDelayDetailCtrl.enddate | date:'yy年MM月dd日'}}
          <standard-time-no-meridian etime="vacationsAddDelayDetailCtrl.endtime"></standard-time-no-meridian>
        </button>
        <button class="button button-block button-positive" ng-click="vacationsAddDelayDetailCtrl.isAdding = true" ng-hide="vacationsAddDelayDetailCtrl.isAdding || vacationsAddDelayDetailCtrl.timelist.length == 1">
          添加
        </button>
        <button class="button button-block button-positive" ng-click="vacationsAddDelayDetailCtrl.addTime(); vacationsAddDelayDetailCtrl.isAdding = false" ng-show="vacationsAddDelayDetailCtrl.isAdding">
          确定
        </button>
        <div>
          <ionic-datepicker id="datepicker" input-obj="vacationsAddDelayDetailCtrl.datepicker">
            <button class="button button-block button-positive" ng-if="false">
              {{vacationsAddDelayDetailCtrl.datepicker.inputDate | date:'yyyy年MM月dd日'}}
              <standard-time-no-meridian etime="vacationsAddDelayDetailCtrl.timepicker.inputEpochTime"></standard-time-no-meridian>
            </button>
          </ionic-datepicker>
        </div>
        <div>
          <ionic-timepicker id="timepicker" input-obj="vacationsAddDelayDetailCtrl.timepicker">
            <button class="button button-block button-light" ng-if="false">
              {{vacationsAddDelayDetailCtrl.timepicker.inputEpochTime}}
            </button>
          </ionic-timepicker>
        </div>

      </div>
    </div>
    <div style="height: 40px"></div>
  </ion-content>

  <div class="fixed-bottom">
    <button class="button button-full button-positive no-margin" ng-click="vacationsAddDelayDetailCtrl.public()" ng-disabled="vacationsAddDelayDetailCtrl.timelist.length == 0 || !vacationsAddDelayDetailCtrl.vacationDelay.reason">提交申请</button>
  </div>
</ion-view>
